package com.tju.backend.dao.ware;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tju.backend.entity.TProduct;
import com.tju.backend.entity.TStereoscopicWarehouse;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * 立体仓库实际库位Mapper接口
 *
 * @author xt-exhibition
 * @date 2021-05-18
 */
public interface StereoscopicWarehouseMapper extends BaseMapper<TStereoscopicWarehouse> {
    /**
     * 查询立体仓库实际库位
     *
     * @param id 立体仓库实际库位ID
     * @return 立体仓库实际库位
     */
    TStereoscopicWarehouse selectStereoscopicWarehouseById(Integer id);

    /**
     * 查询立体仓库实际库位列表
     *
     * @param stereoscopicWarehouse 立体仓库实际库位
     * @return 立体仓库实际库位集合
     */
    List<TStereoscopicWarehouse> selectStereoscopicWarehouseList(TStereoscopicWarehouse stereoscopicWarehouse);

    /**
     * 新增立体仓库实际库位
     *
     * @param stereoscopicWarehouse 立体仓库实际库位
     * @return 结果
     */
    int insertStereoscopicWarehouse(TStereoscopicWarehouse stereoscopicWarehouse);

    /**
     * 修改立体仓库实际库位
     *
     * @param stereoscopicWarehouse 立体仓库实际库位
     * @return 结果
     */
    int updateStereoscopicWarehouse(TStereoscopicWarehouse stereoscopicWarehouse);

    /**
     * 删除立体仓库实际库位
     *
     * @param id 立体仓库实际库位ID
     * @return 结果
     */
    int deleteStereoscopicWarehouseById(Long id);

    /**
     * 批量删除立体仓库实际库位
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    int deleteStereoscopicWarehouseByIds(String[] ids);

    /**
     * 根据条码查询信息
     *
     * @param boxBarcode 需要删除的数据ID
     * @return 结果
     */
    List<TStereoscopicWarehouse> selectStereoscopicWarehouseByBarcode(String boxBarcode);

    /**
     * 根据条码查询信息
     *
     * @param boxBarcode
     * @param sterGrid   里外
     * @return
     */
    TStereoscopicWarehouse selectStereoscopicWarehouseByBarcodeAndSterGrid(String boxBarcode, String sterGrid);

    void updateStatusById(@Param("id") Long id,@Param("updateTime") Date updateTime);

    List<TStereoscopicWarehouse> selectSwByNumber(Integer id);

    int updateStatusByBarcode(@Param("boxBarcode")String boxBarcode, @Param("updateTime")Date updateTime);

    TStereoscopicWarehouse selectOne(String boxBarcode);

    int getTotal();

    int getUsedNum();

    List<TStereoscopicWarehouse> getOrderStatus(@Param("oid") Integer oId);

    IPage<TStereoscopicWarehouse> getOrderStatus(Page<TStereoscopicWarehouse> page, @Param("oid") Integer oId);
    int updateStatus(@Param("status") int status,@Param("id") Long id);
    TStereoscopicWarehouse selectAllstatus(@Param("status") int status);
    List<TStereoscopicWarehouse> selectAll(@Param("status") Integer status,@Param("product")TProduct product);
    List<TStereoscopicWarehouse> selectAllTaskOccupy(@Param("product")TProduct product);
    List<TStereoscopicWarehouse> selectByName(String name);
    int updateStatusTwo(@Param("status") int status,@Param("id") Integer id);
}
